<?php $this->layout='main'; ?>

<?php 

function forwardAddress()
{
	if(Yii::app()->user->userType=='b')//buyer
	{
		$organization_ID=Users::model()->findByPk(Yii::app()->user->userID)->organization_ID;
		$site = Sites::model()->findByAttributes(array('organization_ID'=>$organization_ID));
		if($site==null)
			return Yii::app()->request->baseUrl.'/setup/buyer';
		else
		{
			//TODO: should forward to the payment page
			return Yii::app()->request->baseUrl.'/landing/buyer';
		}
	}
	else if(Yii::app()->user->userType=='s')
	{
		//TODO: should add logic here
		return Yii::app()->request->baseUrl.'/landing/supplier';
	}
}
?>

<div id="thanks">
	<div id="thanks-contents">
		<div id="thanks-text">Thanks you for registering for...</div>
		<div id="thanks-logo">ekos Auctions</div>
		<div id="welcome-to">Welcome to my Place</div>
		<div id="thanks-ch">Thanks Character</div>
	
		<div id="guess-text"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/guess.gif" alt="" /></div>
		<div id="thanks-options">
		    <div>Do you want to fill these</div>
		    <div>out now ...</div>
		    <div class="click-hear"><a href="<?php echo forwardAddress();?>">
		    <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/click-here.jpg" alt="" /></a></div>
		    <div>... OR go to your new</div>
		    <div>custom landing page?</div>
		    <div class="click-hear"><a href="
		    	<?php if(Yii::app()->user->userType=='b')
		    			echo Yii::app()->request->baseUrl."/landing/buyer";
		    		  else if(Yii::app()->user->userType=='s')
		    		  	echo Yii::app()->request->baseUrl."/landing/supplier"; 
		    	?>"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/click-here.jpg" alt="" /></a></div>
		</div><!-- End Thanks Options -->
	
	</div><!-- End Thanks Contents -->
</div>
